home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
utilprn
/
hpdeskje.sit
/
HPDJet ƒ
/
prglobals.h
< prev
next >
Wrap
Text File
|
1989-04-02
|
7KB
|
198 lines
/* 02.04.1989 amn (latest edit) */
/* prglobals.h - global data types and variables. */
/* Authors: Ari Mujunen (amn@hutcs.hut.fi) and Olli Arnberg (oar@hutcs.hut.fi). */
/* Copyright Ari Mujunen, Olli Arnberg 1989. */
/* You may redistribute the driver (=printer resource file, source files, */
/* documentation file(s), and the file 'Copyright and Source Offer') */
/* only _non-commercially_ and _in its entirety_. */
/* See the file 'Copyright and Source Offer' and/or documentation for details. */
/* Acknowledgements: Special thanks to Mr. Earle R. Horton for his 'Daisy' */
/* daisywheel printer driver and its source code published in 'MacTutor', Nov-Dec 1987. */
/* This driver served as a basis and inspiration for our work. It also */
/* proofed that a Macintosh printer driver can be done despite the lack of */
/* documentation from Apple. */
/* Change history: */
/* Version When Who Why */
/* 2.0 18.11.1988 amn Preparing to use fewer globals. */
/* 19.11.1988 amn Font characterization table removed. We are not */
/* required to give a pointer to it to Font Mgr. */
/* 20.11.1988 amn Resolution constants (DPI...) for passing resolution */
/* info from PDEF 4 to PDEF 1 & 5. */
/* 21.11.1988 amn,oar Change of names (xPrintGlobals...). */
/* 23.11.1988 amn Global print record. */
/* 24.11.1988 amn Read printed listing... */
/* 09.12.1988 amn User-specifiable setting 'movePrintPositionBeforeEachWord'. */
/* Handles for spool file header and page picture. */
/* 15.12.1988 amn Is idle proc ours or application's? */
/* 03.02.1989 amn RESID-constants. */
/* 06.02.1989 amn Type tSettings commented. */
/* 10.03.1989 amn Application-specific picture comment type. */
/* (For original string lengths; from TechNote 181.) */
/* 25.03.1989 amn,oar Global resource file refNums removed. */
/* (They change when a new appl. starts in MultiFinder.) */
/* 28.03.1989 amn Settable printer origin. */
/* 30.03.1989 amn,oar Flag to indicate we are _only_ creating a spool file. */
/* 2.1 02.04.1989 amn,oar Released version. */
/***********/
/* Defines */
#define nil (0L)
#define OUR_MAGIC_NUMBER 's89^'
#define PRINTING_MANAGER_VERSION (3)
/* Resource id -8192 belongs to the printer resource file, */
/* id -4080 to the Chooser package. */
#define RESID_OWNED_BY_PDEF (-8192)
#define RESID_OWNED_BY_CHOOSER_PACK (-4080)
/* Used in PDEF 0 & 5 when feeding manually. */
#define SHEETDIALOG (-8193)
/* In dialogs the 'OK' and 'Cancel' buttons are always first. */
#define OKBUTTON 1
#define CANCELBUTTON 2
/* Resolution information as passed in the low-order byte of the field 'prStl.wDev'. */
#define RES_300 0
#define RES_150 1
#define RES_100 2
#define RES_75 3
#define RES_DRAFT 4
#define RES_DEFAULT RES_75
#define RES_MASK 0x0007
/* With this macro we get out the xPrint globals. */
#define GET_XPRINT_GLOBALS ((ptXprintGlobals)(*((*GetDCtlEntry(iPrDrvrRef))->dCtlStorage)))
/************/
/* Typedefs */
/* LightspeedC header files don't have this Printer Driver Control call parameter block. */
typedef struct {
QElemPtr qLink;
int qType;
int ioTrap;
Ptr ioCmdAddr;
ProcPtr ioCompletion;
OsErr ioResult;
StringPtr ioNamePtr;
int ioVRefNum;
int ioRefNum;
int csCode;
long lParam1;
long lParam2;
long lParam3;
/* ==== */
} tPrParam, *ptPrParam, **htPrParam;
typedef struct {
int port; /* 0=modem, 1=printer port */
int baud; /* baud rate part of Driver Reset Info, IM II-250 */
int xonXoff; /* TRUE/FALSE */
Point printerOrigin; /* 300 dpi dots from paper upper left corner */
int screenDumpResolution; /* 75, 100, 150, 300 dpi */
Boolean useOnlyPCLLevel3Features;
Boolean movePrintPositionBeforeEachWord;
} tSettings, *ptSettings, **htSettings;
typedef unsigned char tFileName[64];
/* The comment of kind '100' we use to record the original length of the string */
/* to be drawn next ("ApplicationComment" from TechNote 181). */
typedef struct {
OSType applicationSignature; /* the signature of our driver, 's89^' */
int localKind; /* we have selected '0' */
int originalLengthOfNextTextInPixels;
} tApplicationComment, **htApplicationComment;
/***********/
/* Globals */
/* Shared storage, defined and initialized by the driver code, accessed elsewhere. */
#ifdef DRIVER_MODULE
/* Magic number to make sure these globals are ours. */
static long magicNumber = OUR_MAGIC_NUMBER;
#else
typedef struct {
long magicNumber;
#endif
/* Driver specific settings: which port to use etc. */
tSettings currentSettings;
#ifdef DRIVER_MODULE
/* High-level driver (PDEF0-5) communicates with low-level (XPrint) */
/* using this initialized parameter block. */
static tPrParam xPrintParameterBlock = {
nil, /* qLink */
0, /* qType */
0, /* ioTrap */
nil, /* ioCmdAddr */
nil, /* ioCompletion */
0, /* ioResult */
nil, /* ioNamePtr */
0, /* ioVRefNum */
iPrDrvrRef, /* ioRefNum */
0, /* csCode */
0L, 0L, 0L /* lParam */
};
/* The previous 'xPrintParameterBlock.ioNamePtr' always points to this name ('.Print'). */
static tFileName xPrintName = sPrDrvr;
#else
tPrParam xPrintParameterBlock;
tFileName xPrintName;
#endif
/* Used when low-level driver (XPrint) writes to the serial driver. */
ParamBlockRec serialParameterBlock;
/* The strings (user-definable) which perform printer control functions as FF, LF etc. */
Str255 prinitstr;
tFileName prlfstr;
tFileName prtopstr;
tFileName preopstr;
tFileName preofstr;
/* Information from OpenDoc until CloseDoc/PrPicFile: */
TPrint printRecord; /* page range, idle procedure address etc. */
Boolean applicationOwnsIdleProc;
tFileName spoolFileName; /* print record contains a pointer to this, thus it is global */
int spoolFileRefNum; /* needed in customized QD get&put picture data procedures */
#ifdef DRIVER_MODULE
static Boolean spoolFileIsNamedAndPermanent = FALSE;
static Boolean spoolFileAlreadyNamed = FALSE;
#else
Boolean spoolFileIsNamedAndPermanent;
Boolean spoolFileAlreadyNamed;
#endif
int pageCounter;
THPfHeader hSpoolFileHeader; /* used in PDEF 1 from OpenDoc until CloseDoc */
PicHandle hPagePicture; /* used in PDEF 1 from OpenPage until ClosePage */
int originalStringLength; /* in PDEF5: from length picture comment until stdText */
/* SysEnvRec theWorld; has been withdrawn: we don't have the new ROMs. */
#ifdef DRIVER_MODULE
#else
} tXprintGlobals, *ptXprintGlobals, **htXprintGlobals;
#endif